﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="userlist.aspx.cs" Inherits="Mocola.Net.Web.userlist" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>CsLand Ams v1.0 - 中新置地档案管理系统</title>
    <meta name="description" content="CsLand Ams v1.0 - 中新置地档案管理系统" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />

    <link rel="stylesheet" href="css/content.css" type="text/css" />
    <link rel="stylesheet" href="css/ui.css" type="text/css" />
    <link rel="stylesheet" href="css/sys.css" type="text/css" />
   	<link rel="stylesheet" href="css/table.css" type="text/css" />
   	
   	<link rel="stylesheet" media="screen" href="css/vlaCal-v2.1.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/vlaCal-v2.1-adobe_cs3.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/vlaCal-v2.1-apple_widget.css" type="text/css" />
	<link rel="stylesheet" href="scripts/formcheck/theme/classic/formcheck.css" type="text/css" media="screen" />
	
    <!--[if IE]>
	    <script type="text/javascript" src="scripts/excanvas-compressed.js"></script>	
	    <style type="text/css"> html { overflow: auto; } </style>	
    <![endif]-->
    	
    <script type="text/javascript" src="scripts/mootools-1.2-core.js"></script>
    <script type="text/javascript" src="scripts/mootools-1.2-more.js"></script>	
    <script type="text/javascript" src="scripts/mocha.js"></script>
    <script type="text/javascript" src="scripts/mocola-funs.js"></script>
    <script type="text/javascript" src="scripts/vlaCal-v2.1-compressed.js"></script>
    <script type="text/javascript" src="scripts/vlaCal-v2.1-clientside.js"></script>
    <script type="text/javascript" src="scripts/formcheck/lang/cn.js"> </script>
    <script type="text/javascript" src="scripts/formcheck/formcheck.js"> </script>
</head>
<body style="padding: 5px;">
    <form id="form1" runat="server">
    <div class="dvspecalt">
        <div style="padding: 5px;">
            <input id="btnNew" type="button" value="新增" class="btnzc" style="width:100px" onclick="location.replace('newuser.aspx')"/>
        </div>
    </div>
    <div class="dvspec" style="margin-top: 5px;" id="DvUsers">
        <div style="padding: 10px; overflow: auto;height:300px;">
            <div class="title1">用户列表：</div>
            <table class="table2" cellspacing="0" style="margin-top: 5px; border: 1px #C1DAD7 solid; ">
                <tr>
                    <th style="width: 5%">
                    <asp:CheckBox ID="chkMap_All" runat="server" onclick="ChkAll(this,'DvUsers')" />
                    </th>
                    <th style="width: 100px">
                        用户名
                    </th>
                    <th style="width: 60px">
                        姓名
                    </th>
                    <th style="width: 40px">
                        性别
                    </th>
                    <th style="width: 160px">
                        Email
                    </th>
                    <th style="width: 40px">
                        状态
                    </th>
                    <th style="width: 120px">
                        所属部门
                    </th>
                    <th style="width: 100px">
                        身份/角色
                    </th>
                    <th style="width: 100px">
                        操作
                    </th>
                 </tr>
            <asp:Repeater ID="rptUsers" runat="server" OnItemDataBound="rptUsers_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td align="center"><asp:CheckBox ID="chkUsersItem" runat="server" /><asp:HiddenField ID="hfUserID" runat="server" /></td>
                        <td><%# Eval("UserName")%></td>
                        <td><font color="#666"><%# Eval("FullName")%></font></td>
                        <td align="center"><%# Eval("Sex")%></td>
                        <td><a href='mailto:<%# Eval("Email")%>'><%# Eval("Email")%></a></td>
                        <td align="center"><%# Eval("Status")%></td>
                        <td ><asp:Literal ID="lblDepart" runat="server" Text=''></asp:Literal></td>
                        <td><%# Eval("RoleName")%></td>
                        <td align="center">
                            <input type="button" value="编辑" class="btnzc" onclick="location.replace('newuser.aspx?UserID=<%# Eval("UserID")%>')"/>
                            <input type="button" value="删除" class="btnzc" onclick="if(!confirm('您确定要删除这个用户吗？')){return false;}else{delUser(<%# Eval("UserID")%>)}"/>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
                 
             </table>
        </div>
    </div>
    <script type="text/javascript">
        function ChkAll(obj, tagID) {
            var arr = $(tagID).getElementsByTagName("input");
            {
                for (var i = 0; i < arr.length; i++) {
                    arr[i].checked = obj.checked;
                }
            }
        }
        function chkData() {
            var count = 0;
            var arr = $("DvUsers").getElementsByTagName("input");
            {
                for (var i = 0; i < arr.length; i++) {
                    if (arr[i].checked) count++;
                }
            }
            arr = $("DivFiles").getElementsByTagName("input");
            {
                for (var i = 0; i < arr.length; i++) {
                    if (arr[i].checked) count++;
                }
            }
            if (count == 0) {
                alert("请选择用户！");
                return false;
            }
        }
        function delUser(UserID)
        {
            var req = new Request(
            {
                url: 'ajax/Deluser.aspx?UserID=' + UserID,
                onSuccess: function(txt) {
                    alert("删除用户成功!");
                    location.replace("userlist.aspx");
                },
                onFailure: function() {
                    alert("删除用户失败!");
                }
            });
            req.send();
        }
    </script>
    </form>
</body>
</html>
